<template>
  <div>
    <div>
      <a href="https://vitejs.dev" target="_blank"> </a>
      <a href="https://vuejs.org/" target="_blank"> </a>
    </div>
    <h1 class="text-3xl font-bold underline">Hello world!</h1>

    <div class="text-3xl">通过ref 引入 {{ countRef }}</div>
    <hr />
    <div class="mb-4 mt-[20px]">
      <el-button>Default</el-button>
      <el-button type="primary">Primary</el-button>
      <el-button type="success">Success</el-button>
      <el-button type="info">Info</el-button>
      <el-button type="warning">Warning</el-button>
      <el-button type="danger">Danger</el-button>
    </div>

    <div class="mb-4">
      <el-button plain>Plain</el-button>
      <el-button type="primary" plain>Primary</el-button>
      <el-button type="success" plain>Success</el-button>
      <el-button type="info" plain>Info</el-button>
      <el-button type="warning" plain>Warning</el-button>
      <el-button type="danger" plain>Danger</el-button>
    </div>

    <div class="mb-4">
      <el-button round>Round</el-button>
      <el-button type="primary" round>Primary</el-button>
      <el-button type="success" round>Success</el-button>
      <el-button type="info" round>Info</el-button>
      <el-button type="warning" round>Warning</el-button>
      <el-button type="danger" round>Danger</el-button>
    </div>
    <div>
      <el-button :icon="Search" circle />
      <el-button type="primary" :icon="Edit" circle />
      <el-button type="success" :icon="Check" circle />
      <el-button type="info" :icon="Message" circle />
      <el-button type="warning" :icon="Star" circle />
      <el-button type="danger" :icon="Delete" circle />
    </div>
    <div>
      <!-- 你需要直接提供它们 -->
      <Edit style="width: 1em; height: 1em; margin-right: 8px" />
      <Share style="width: 1em; height: 1em; margin-right: 8px" />
      <Delete style="width: 1em; height: 1em; margin-right: 8px" />
      <Search style="width: 1em; height: 1em; margin-right: 8px" />
      <p>
        with extra class <b>is-loading</b>, your icon is able to rotate 360 deg
        in 2 seconds, you can also override this
      </p>
      <el-icon :size="20">
        <Edit />
      </el-icon>
      <el-icon color="#409efc" class="no-inherit">
        <Share />
      </el-icon>
      <el-icon>
        <Delete />
      </el-icon>
      <el-icon class="is-loading">
        <Loading />
      </el-icon>
      <el-button type="primary">
        <el-icon style="vertical-align: middle">
          <Search />
        </el-icon>
        <span style="vertical-align: middle"> Search </span>
      </el-button>
    </div>
    <div>
      <p>svg</p>
      <div>
        <span>一个refresh svg </span>
        <svg-icon icon-class="userNum" />
      </div>
    </div>
    <div>
      <p>axios 请求</p>
      <el-button @click="login">登录按钮</el-button>
    </div>
    <TsxTest />
  </div>
</template>

<script lang="ts" setup>
import TsxTest from "@/components/TsxTest.tsx";
import type { Action } from "element-plus";

import { loginWidthPWd } from "@/api/test";
const countRef = ref(345);
import {
  Check,
  Delete,
  Edit,
  Message,
  Search,
  Star,
} from "@element-plus/icons-vue";

const open = () => {
  ElMessageBox.alert("This is a message", "Title", {
    // if you want to disable its autofocus
    // autofocus: false,
    confirmButtonText: "OK",
    callback: (action: Action) => {
      ElMessage({
        type: "info",
        message: `action: ${action}`,
      });
    },
  });
};
open();

const login = () => {
  let params = {
    userPwd: "777777",
    userTel: "183xxxxxxx1",
  };
  loginWidthPWd(params).then((res) => {
    console.log(res);
  });
};
</script>
